<template>
    <div class="detail">
        <div class="detail-container">
            <h2 class="detail-title">{{detailList.title}}</h2>
            <span class="time">{{detailList.createtime}}</span>
            <div class="detail-content" v-html="detailList.content">
                
            </div>
        </div>
    </div>
</template>

<script>
    import axios from 'axios'
    export default {
        name: "Detail",
        data () {
            return {
                id: '',
                detailList: {}
            }
        },
        methods: {
            getDetailInfo () {
                // 根据id请求json数据
                axios.get('/api/index.php?g=Api&m=Guanwang&a=lawdetail&id='+this.$route.params.id).then((res) => {
                    this.detailList = res.data
                    console.log(this.detailList)
                })
            }
        },
        created () {
            this.id = this.$route.params.id
            this.getDetailInfo()
        }
    }
</script>

<style lang="stylus" scoped>
    .detail-content >>> img
        width: 100%

    .detail
        width: 100%
        height: 100%
        position: relative
        background: #fff
        padding-top: 20px
        .detail-container
            padding: 0 15px 120px 15px
            box-sizing: border-box
            width: 100%
            oveflow: hidden
            background: #fff
            .detail-title
                font-size: 18px
                font-weight: 700
                line-height: 130%
                width: 100%
                text-align: center
            .time
                font-size: 12px
                color: #888
                display: block
                width: 100%
                text-align: center
                margin: 10px 0 0px
            .detail-content
                width: 100%
                line-height: 150%
                font-size: 16px
                overflow: hidden
</style>

